package com.gourd.common.log.entity;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.gourd.common.data.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author gourd
 * @date 2018-11-24
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("sys_log")
public class Log extends BaseEntity {

    /**
     * 操作用户
     */
    @TableField(value = "user_id")
    private Long userId;
    /**
     * 操作用户
     */
    @TableField(value = "user_name")
    private String userName;

    /**
     * 描述
     */
    @TableField(value = "description")
    private String description;

    /**
     * 方法名
     */
    @TableField(value = "method")
    private String method;

    /**
     * 参数
     */
    @TableField(value = "params")
    private String params;

    /**
     * 日志类型
     */
    @TableField(value = "log_type")
    private String logType;

    /**
     * 请求ip
     */
    @TableField(value = "request_ip")
    private String requestIp;

    /**
     * 请求耗时
     */
    @TableField(value = "time")
    private Long time;

    /**
     * 异常详细
     */
    @TableField(value = "exception_detail")
    private String exceptionDetail;


    public Log(String logType, Long time) {
        this.logType = logType;
        this.time = time;
    }
}
